PROJECT(TERMIT)

INCLUDE(UsePkgConfig)

ADD_DEFINITIONS(-Wall)

SET(TERMIT_DISTR_FILES CMakeLists.txt)

SET(DEBUG FALSE CACHE BOOL "debug info")
SET(ENABLE_NLS TRUE CACHE BOOL "enable translation")

SET(TERMIT_PACKAGE "termit")
SET(TERMIT_PACKAGE_VERSION "1.1")
SET(TERMIT_LOCALE_DIR "${CMAKE_INSTALL_PREFIX}/share/locale")
SET(TERMIT_PACKAGE_NAME "termit - terminal emulator")
SET(TERMIT_PACKAGE_STRING "${TERMIT_PACKAGE} ${TERMIT_PACKAGE_VERSION}")
SET(TERMIT_PACKAGE_BUGREPORT "ratnikov.ev@gmail.com")

CONFIGURE_FILE(${TERMIT_SOURCE_DIR}/config.h.in ${TERMIT_SOURCE_DIR}/config.h)

CONFIGURE_FILE(
  "${CMAKE_CURRENT_SOURCE_DIR}/cmake/cmake_uninstall.cmake.in"
  "${CMAKE_CURRENT_BINARY_DIR}/cmake/cmake_uninstall.cmake"
  IMMEDIATE @ONLY)
ADD_CUSTOM_TARGET(uninstall
  "${CMAKE_COMMAND}" -P "${CMAKE_CURRENT_BINARY_DIR}/cmake/cmake_uninstall.cmake")

FIND_LIBRARY(VTE_LIBRARY vte PATHS /usr/lib /usr/local/lib)
IF(NOT VTE_LIBRARY)
  MESSAGE(FATAL_ERROR "vte library not found")
ENDIF(NOT VTE_LIBRARY)

ADD_SUBDIRECTORY(doc)
ADD_SUBDIRECTORY(src)
IF(ENABLE_NLS)
  ADD_SUBDIRECTORY(po)
ENDIF(ENABLE_NLS)

MESSAGE("\n  termit ${TERMIT_PACKAGE_VERSION}\n")
MESSAGE("Prefix dir:.......... ${CMAKE_INSTALL_PREFIX}")
IF(ENABLE_NLS)
  MESSAGE("Locales dir:......... ${TERMIT_LOCALE_DIR}")
ENDIF(ENABLE_NLS)
MESSAGE("VTE:................. ${VTE_LIBRARY}")
MESSAGE("Debug:............... ${DEBUG}")
MESSAGE("\n")

MESSAGE("distr: ${TERMIT_DISTR_FILES}")
MESSAGE("qq: $ENV{QQ}")

